package cn.yuanqiao.archive.fondsFolder.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class FondsFolder extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_FONDSFOLDER";

    public FondsFolder() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    @IdAnnotation
    private Long id;

    private String tableName;
    //1 大事记 2 组织沿革
    private Integer type;
    //标题
    private String title;
    //机关单位
    private String jgdw;
    //年度(月、季度)
    private String nd;
    //文种
    private String wz;

    // 1：删除 0：未删除
    private Integer isDel;

    private Long deptId;

    private Long userId;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date publishTime;
    //是否发布  1 是 0 否
    private Integer isPublish;
    //富文本内容
    private String content;
    private String content2;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getJgdw() {
        return jgdw;
    }

    public void setJgdw(String jgdw) {
        this.jgdw = jgdw;
    }

    public String getNd() {
        return nd;
    }

    public void setNd(String nd) {
        this.nd = nd;
    }

    public String getWz() {
        return wz;
    }

    public void setWz(String wz) {
        this.wz = wz;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getIsPublish() {
        return isPublish;
    }

    public void setIsPublish(Integer isPublish) {
        this.isPublish = isPublish;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent2() {
        return content2;
    }

    public void setContent2(String content2) {
        this.content2 = content2;
    }

    @Override
    public String toString() {
        return "FondsFolder{" +
                "type=" + type +
                ", title='" + title + '\'' +
                ", jgdw='" + jgdw + '\'' +
                ", nd='" + nd + '\'' +
                ", wz='" + wz + '\'' +
                ", isDel=" + isDel +
                ", deptId=" + deptId +
                ", userId=" + userId +
                ", publishTime=" + publishTime +
                ", isPublish=" + isPublish +
                ", content='" + content + '\'' +
                ", content2='" + content2 + '\'' +
                '}';
    }
}
